﻿//F# の詳細 (http://fsharp.net)

let intArray = [| 1..100 |]
let intList = [ 1..100 ]

let isOdd i = i % 2 = 1
let square i = i * i

let result =
    [ 1..100 ]
    |> Seq.filter (fun i -> i % 2 = 1)
    |> Seq.map (fun i -> i * i)
    |> Seq.take 10
    |> Seq.sortBy (fun i -> string i)
    |> Seq.toArray
for i in result do
    printfn "%d" i

let result2 =
    [ 1..100 ]
    |> Seq.filter isOdd
    |> Seq.map square
    |> Seq.take 10
    |> Seq.sortBy string
    |> Seq.toArray
for i in result2 do
    printfn "%d" i
